<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Person() {
        this.getName = function () {
          return this.name;
        };
      }
      function User(name, age) {
        this.name = name;
        this.age = age;
      }
      let lisi = new User('李四', 12);
      Object.setPrototypeOf(lisi, new Person());
      console.log(lisi.__proto__);
      console.log(lisi);
      console.log(lisi.getName()); //李四
      // Object.setPrototypeOf(User, Person);
      // console.dir(User);
    </script>
  </body>
</html>
